/*
 * scala-swing (https://www.scala-lang.org)
 *
 * Copyright EPFL, Lightbend, Inc., contributors
 *
 * Licensed under Apache License 2.0
 * (http://www.apache.org/licenses/LICENSE-2.0).
 *
 * See the NOTICE file distributed with this work for
 * additional information regarding copyright ownership.
 */

package scala.swing.examples

import scala.swing.*
import scala.swing.event.*

object ButtonApp extends SimpleSwingApplication:
    def top: Frame = new MainFrame:
        title = "My Frame"
        contents = new GridPanel(2, 2):
            hGap = 3
            vGap = 3
            contents += new Button:
                text = "Press Me!"
                reactions += {
                    case ButtonClicked(_) => text = "Hello Scala"
                }
        size = new Dimension(300, 80)
end ButtonApp
